﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CRConsult.Models;

namespace CRConsult.Controllers
{
    public class NewsController : Controller
    {
        newsRepository newsdb = new newsRepository();

        //
        // GET: /News/
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult List(int id) {
            var items = newsdb.getNewsListByCategory(id).ToArray();
            return Json(items, JsonRequestBehavior.AllowGet);
        }
    }
}
